package com.yycwxt.modules.admin.subject;

import com.yycwxt.common.BaseService;
import com.yycwxt.domain.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class SubjectService extends BaseService<SubjectMapper,Subject> {

    private SubjectMapper subjectMapper;

    public SubjectService(@Autowired SubjectMapper subjectMapper){
        this.subjectMapper = subjectMapper;
    }

    @Transactional
    public int insert(Subject subject){
        return subjectMapper.insert(subject);
    }

    @Transactional
    public int update(Subject subject){
        return subjectMapper.updateById(subject);
    }

    public List<Subject> selectByInput(String input){
        return subjectMapper.selectByInput(input);
    }

    public List<Subject> selectAll(){
        return subjectMapper.selectAll();
    }
}
